package user

import (
	"shop/formdata"
	user1 "shop/internal/models/user"
)

func SearchByPhone(phone string) (user1.User, error) {
	u := new(user1.User)
	return u.UserSearchByPhone(phone)
}

func UserRegister(phone, pass string) (*user1.User, error) {
	return new(user1.User).UserAdd(phone, pass)
}

func UserPasswordUpd(phone, pass string) (user1.User, error) {
	return new(user1.User).UpdatePassword(phone, pass)
}

func UserPhoneUpd(phone, newPhone string) (user1.User, error) {
	return new(user1.User).UpdatePhone(phone, newPhone)
}

func UserStatusUpd(userID int) (user1.User, error) {
	return new(user1.User).UpdateStatus(userID)
}

func UserMessageUdp(message formdata.UserMessage) (*user1.User, error) {
	return new(user1.User).UserUpdate(message)
}

func UserSearchBYUserId(userID int) (user1.User, error) {
	return new(user1.User).UserSearchByID(userID)
}
